<?php

namespace App\Common;

class Comiter
{

    public static function success($code=200,$msg='msg',$data=[]){
        $res=[
            'code'=>$code,
            'msg'=>$msg,
            'data'=>$data
        ];
        return response()->json($res);
    }

    public static function fail($code=500,$msg='失败',$data=[]){
        $res=[
            'code'=>$code,
            'msg'=>$msg,
            'data'=>$data
        ];
        return response()->json($res);
    }
}
